Skip to main content

All Questions

-2votes
1answer
172views

Parse fixed width file and lookup those parsed values against Oracle Db

Files arrive within a specific time window (midnight-0600hrs EST) and get saved to the orders directory on the Linux host. these files are stored in a zip format. usually around 30 files are expected ...
Jits's user avatar
-1votes
1answer
2kviews

Check if there exists filename in directory

I have one file contains people name, like Sam Tom Dad Jack I have one directory that contains name.txt or name.zip which file's form is not the same, like Dad.txt Tom.zip Jack.zip How to find sam ...
TangPing's user avatar
0votes
1answer
618views

Sed Bash script only runs first line of sed

My bash script only runs first line of sed. The command i use to run it: sed -f sedhw.bash thesbians.txt Contents of sedhw.bash s/[0-9]*//g s/1908/---/g; s/1895/---/g; s/1903/---/g s/,.*//g s/^[^&...
Jimmy Gonzalez's user avatar
3votes
2answers
485views

Remove duplicate lines from files recursively in place but leave one - make lines unique across files

I have many folders and folders contain files. The same line might appear multiple times in single file and/or in multiple files. Files are not sorted. So there are some lines duplicated across ...
Ikrom's user avatar
0votes
2answers
115views

Add trailing word to a specific line in file

I have a file contains many lines like this for example AAA ATAGSGSGS BBB Thhahahahahs CCC lmmmmm DDD GAGAGAGAGA AAA IIIII BBB OOOO CCC YYYYY ...and so on I want to add specific word i the end of ...
Reda's user avatar
  • 103
5votes
4answers
3kviews

Counter of unique files in a directory

I ran a program many times with output that was (slightly) non-deterministic. Each time, I printed the output to a file. I now have a directory of many text files (95,034), which probably have ...
jxmorris12's user avatar
-4votes
1answer
516views

How to read a file line by line then take each line and insert into txt file

I want to read each line of a file and then take each line and produce a file with the lines data in it. For example let say the file I want to read is named txt.txt and it has the below 4 lines: ...
Sean's user avatar
5votes
3answers
622views

Add lines to files to make them equal length

I have a bunch of .csv files with N columns and different number of rows (lines). I would like to add as many empty lines ;...; (N semicolons) to make them the same length. I can get the length of the ...
myradio's user avatar
4votes
4answers
706views

If Else, Awk NR: How to remove a section header of table where there are no entries

I am trying to summarise a table of data that changes everyday. I have already summarised the table to only display rows with entries that are larger than 30. However, on some days, there are no ...
tthhss's user avatar
0votes
3answers
23kviews

Find total of marks for each student in the given file

the file: Name: Rad Eng: 94 Tam: 98 Mat: 98 Soc: 98 Sci: 80 Name: Din Eng: 87 Tam: 89 Mat: 78 Soc: 87 Sci: 34 Name: Hardy Eng: 78 Tam: 87 Mat: 23 Soc: 34 Sci: 98 the script : #!/bin/bash file=$1 num=...
Radhakrishnan Rk's user avatar
2votes
4answers
572views

Duplicate a file multiple times, write to duplicated files, sort the files, count position of specific lines after sorting

Before I go to more in details, I want to point out that I already asked a certain part of this question -> You can find it here. I received some nice answers, but I need to do more so I'll repeat my ...
Osman Altun's user avatar
1vote
4answers
268views

split 1200 page document into 500 pages and then the remaining

I am new to the Unix world, and I have text files that contain 1200 pages identified by ^L. Is there an effective way to break of that file to have 2 separate files of 500 pages each and then a 3rd ...
gizmo's user avatar
20votes
6answers
8kviews

Running a command on many files

I've got a folder with many files (xyz1, xyz2, all the way up to xyz5025) and I need to run a script on every one of them, getting xyz1.faa, xyz2.faa, and so on as outputs. The command for a single ...
Manuel's user avatar
1vote
2answers
1kviews

Shell command to save list of movies to csv

I am trying to write a one line shell command (bash) to save a list of movies to a CSV file. I am okay with using a script if needed. My folders are laid out as follows: -Movies/ --A/ ---...
Matthew Kelley's user avatar
1vote
1answer
92views

Transpose a 3D tensor reprensented by files

I have a 3D tensor of dimension MxNxD data object. And this data object is decomposed and stored in different files. Initially, each slice/matrix of dimension MxN (first two dimension) is saved in a ...
xiaohan2012's user avatar

153050per page
close